package com.hxwang.tanke;

import java.io.IOException;
import java.util.Properties;

/**
 * <H2> 从配置文件里取值 </H2>
 *
 * @author hxwang
 * @data 2023/1/1
 */

public class PropertyMgr {
    static Properties props = new Properties();

    static {
        try {
            props.load(PropertyMgr.class.getClassLoader().getResourceAsStream("config"));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static Object get(String key) {
        if (props == null) {
            return null;
        }
        return props.get(key);
    }
}
